<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%@ taglib
	uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="">
<base href="<%=basePath%>">
<title>本周待办</title>
<link rel="stylesheet"
	href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
<link rel="stylesheet"
	href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
<link rel="stylesheet" type="text/css" href="resourse/css/demos.css">
</head>
<body ontouchstart>
	<div
		style="background: blue; height: 50px; margin: 5px; color: #FFFFFF; text-align: center; font-size: 18px; line-height: 50px;">海科新源协同办公系统</div>
	<div class="weui-cells weui-cells_form">
		<div class="weui-cell">
			<div class="weui-cell__hd">
				<input type="hidden" value="${map1['PRO_ID']}" id="proId" /> <input
					type="hidden" value="${map1['INF_ID']}" id="infId" /> <input
					type="hidden" value="${map1['PROR_PROGRESS']}" id="progressId" /><label
					class="weui-label">会议名称：</label>
			</div>
			<div class="weui-cell__bd">
				<span>${map1['INF_METTINGNAME']}</span>
			</div>
		</div>

		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">待办事项：</label>
			</div>
			<div class="weui-cell__bd">${map1['PRO_CONTENT']}</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">本周工作：</label>
			</div>
			<div class="weui-cell__bd">
				<textarea id="taskinfo" class="weui-textarea" placeholder="请输入文本"
					rows="3">${map1['PROR_CONTENT']}</textarea>
				<div class="weui-textarea-counter">
					<span>0</span>/200
				</div>
			</div>
		</div>

		<div class="weui-cell">
			<div class="weui-cell__hd">
				<label class="weui-label">整体进度：</label>
			</div>
			<div class="weui-cell__bd">
				<div class="weui-slider-box" id='slider1'>
					<div class="weui-slider">
						<div id="sliderInner" class="weui-slider__inner">
							<div id="sliderTrack" style="width: ${map1['PROR_PROGRESS']}%;"
								class="weui-slider__track"></div>
							<div id="sliderHandler" style="left: ${map1['PROR_PROGRESS']}%;"
								class="weui-slider__handler"></div>
						</div>
					</div>
					<div id="sliderValue" class="weui-slider-box__value">${map1['PROR_PROGRESS']}</div>
				</div>
			</div>
		</div>

		<div class="weui-cells weui-cells_form">
			<div class="weui-cell">
				<div class="weui-cell__hd">
					<span>计划完成日期：</span>
				</div>
				<div class="weui-cell__bd">
					<input class="weui-input" type="date"
						value="${map1['PRO_PLANFINISHDATE']}" id="datePlan">
				</div>
			</div>
		</div>
	</div>
	<div style="text-align: center;">
		<a href="javascript:save();"
			class="weui-btn weui-btn_mini weui-btn_primary">保存</a>&nbsp;&nbsp;&nbsp;<a
			href="javascript:commit();"
			class="weui-btn weui-btn_mini weui-btn_primary">提交</a>&nbsp;&nbsp;&nbsp;<a
			href="wx/taskDelay?proId=${map1['PRO_ID']}&infId=${map1['INF_ID']}&oldDate=${map1['PRO_PLANFINISHDATE']}"
			class="weui-btn weui-btn_mini weui-btn_primary">延期</a>
	</div>
	<!-- body 最后 -->
	<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
	<script
		src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>
	<script>
		$(function() {
			// 			var a = '{PRO_EXECUTEUSERID=19075d94-0fdf-4c08-ab20-3b8132756f72,  PRO_PLANFINISHDATE=,  PRO_EXECUTEUSERNAME=杨献峰,  PRO_CONTENT=要求思派公司尽快调研电解液盈利问题和DMC项目重新启动问题，如果市场允许，DMC项目必须赶在石大胜华泉州项目开工前投产。,  INF_ID=cce562ae-0112-4e49-8dbe-7b5247fecaa4,  INF_METTINGNAME=2019年第26次总裁办公会(10.18),  PRO_ID=53c5c1fc-c8d1-4fdd-a662-7b31b423c82a}';
			// 			var b = '{PRO_EXECUTEUSERID=19075d94-0fdf-4c08-ab20-3b8132756f72, PRO_ID=53c5c1fc-c8d1-4fdd-a662-7b31b423c82a, PRO_EXECUTEUSERNAME=杨献峰, INF_ID=cce562ae-0112-4e49-8dbe-7b5247fecaa4, INF_METTINGNAME=2019年第26次总裁办公会(10.18), PRO_CONTENT=要求思派公司尽快调研电解液盈利问题和DMC项目重新启动问题，如果市场允许，DMC项目必须赶在石大胜华泉州项目开工前投产。, PRO_PLANFINISHDATE=}';
			// 			$('#sliderValue').html(10);
			// 			$("#sliderTrack").css('width', "10%");
			// 			$("#sliderHandler").css('left', '10%');
			progress = $('#progressId').val();
		});
		function save() {
			if ($('#datePlan').val() == '' || $('#datePlan').val() == null) {
				$.toast('请选择计划完成日期', 'text');
				return;
			}
			if (progress == '') {
				$.toast('请选择进度', 'text');
				return;
			}
			if ($('#taskinfo').val() == '') {
				$.toast('请填写本周工作', 'text');
				return;
			}
			$.showLoading();
			$.ajax({
				type : "post",
				headers: {
			        token: localStorage.getItem('token')
			    },
				url : "task/saveProjectresult",
				data : {
					inf_id : $('#infId').val(),
					content : $('#taskinfo').val(),
					progress : progress,
					planDate : $('#datePlan').val(),
					proId : $('#proId').val()
				},
				success : function(data) {
					$.hideLoading();
					$.toast("操作成功");
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					$.toast(errorThrown, 'text');
				}
			});
		}
		function commit() {
			if ($('#datePlan').val() == '' || $('#datePlan').val() == null) {
				$.toast('请选择计划完成日期', 'text');
				return;
			}
			if (progress == '') {
				$.toast('请选择进度', 'text');
				return;
			}
			if ($('#taskinfo').val() == '') {
				$.toast('请填写本周工作', 'text');
				return;
			}
			$.showLoading();
			$.ajax({
				type : "post",
				url : "task/commitProjectresult",
				data : {
					inf_id : $('#infId').val(),
					content : $('#taskinfo').val(),
					progress : progress,
					planDate : $('#datePlan').val(),
					proId : $('#proId').val()
				},
				success : function(data) {
					$.hideLoading();
					window.location.href="wx/taskList";
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					$.toast(errorThrown, 'text');
				}
			});
		}
	</script>
	<script>
		var progress = 0;
		$('#slider1').slider(function(per) {
			progress = per;
		});
	</script>
</body>
</html>